package com.me.web.pubsub.consumer;

import com.alibaba.fastjson2.JSONObject;
import com.me.web.pubsub.vo.CaffeineCacheMessage;
import com.me.web.pubsub.vo.YanfanConstant;
import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;

/**
 * @author gsb
 * @date 2023/2/27 14:33
 */
@Slf4j
@Component
public class DeviceOtherMsgConsumer {



    @Async(YanfanConstant.TASK.DEVICE_OTHER_TASK)
    public void consume(CaffeineCacheMessage bo) {
        try {
            //处理emq订阅的非 property/post 属性上报的消息 ，因为其他消息量小，放在一起处理
            System.out.println("DeviceOtherMsgConsumer");
            System.out.println(JSONObject.toJSONString(bo));
        } catch (Exception e) {
            log.error("=>设备其他消息处理出错", e);
        }
    }

}
